<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    1003. Minimum Area Rectangle II
   </h1>
   <p>
    Given a set of points in the xy-plane, determine the minimum area of
    <strong>
     any
    </strong>
    rectangle formed from these points, with sides
    <strong>
     not necessarily parallel
    </strong>
    to the x and y axes.
   </p>
   <p>
    If there isn't any rectangle, return 0.
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     Example 1:
    </strong>
   </p>
   <p>
    <img alt="" src="https://assets.leetcode.com/uploads/2018/12/21/1a.png" style="width: 150px; height: 151px;">
   </p>
   <pre>
<strong>Input: </strong><span id="example-input-1-1">[[1,2],[2,1],[1,0],[0,1]]</span>
<strong>Output: </strong><span id="example-output-1">2.00000
<strong>Explanation:</strong> </span><span>The minimum area rectangle occurs at [1,2],[2,1],[1,0],[0,1], with an area of 2.</span>
</pre>
   <div>
    <p>
     <strong>
      Example 2:
     </strong>
    </p>
    <p>
     <img alt="" src="https://assets.leetcode.com/uploads/2018/12/22/2.png" style="width: 150px; height: 94px;">
    </p>
    <pre>
<strong>Input: </strong><span id="example-input-2-1">[[0,1],[2,1],[1,1],[1,0],[2,0]]</span>
<strong>Output: </strong><span id="example-output-2">1.00000
</span><strong>Explanation:</strong> The minimum area rectangle occurs at [1,0],[1,1],[2,1],[2,0], with an area of 1.
</pre>
    <div>
     <p>
      <strong>
       Example 3:
      </strong>
     </p>
     <p>
      <img alt="" src="https://assets.leetcode.com/uploads/2018/12/22/3.png" style="width: 160px; height: 167px;">
     </p>
     <pre>
<strong>Input: </strong><span id="example-input-3-1">[[0,3],[1,2],[3,1],[1,3],[2,1]]</span>
<strong>Output: </strong><span id="example-output-3">0
</span><span><strong>Explanation:</strong> There is no possible rectangle to form from these points.</span>
</pre>
     <div>
      <p>
       <strong>
        Example 4:
       </strong>
      </p>
      <p>
       <img alt="" src="https://assets.leetcode.com/uploads/2018/12/21/4c.png" style="width: 160px; height: 155px;">
      </p>
      <pre>
<strong>Input: </strong><span id="example-input-4-1">[[3,1],[1,1],[0,1],[2,1],[3,3],[3,2],[0,2],[2,3]]</span>
<strong>Output: </strong><span id="example-output-4">2.00000
</span><span><strong>Explanation:</strong> The minimum area rectangle occurs at [2,1],[2,3],[3,3],[3,1], with an area of 2.</span>
</pre>
     </div>
     <p>
      &nbsp;
     </p>
    </div>
   </div>
   <p>
    <strong>
     Note:
    </strong>
   </p>
   <ol>
    <li>
     <code>
      1 &lt;= points.length &lt;= 50
     </code>
    </li>
    <li>
     <code>
      0 &lt;=&nbsp;points[i][0] &lt;=&nbsp;40000
     </code>
    </li>
    <li>
     <code>
      0 &lt;=&nbsp;points[i][1] &lt;=&nbsp;40000
     </code>
    </li>
    <li>
     All points are distinct.
    </li>
    <li>
     Answers within
     <code>
      10^-5
     </code>
     of the actual value will be accepted as correct.
    </li>
   </ol>
  </div>
  <div>
   <h1 class="question_title">
    1003. 最小面积矩形 II
   </h1>
   <p>
    给定在 xy 平面上的一组点，确定由这些点组成的任何矩形的最小面积，其中矩形的边
    <strong>
     不一定平行于
    </strong>
    x 轴和 y 轴。
   </p>
   <p>
    如果没有任何矩形，就返回 0。
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     示例 1：
    </strong>
   </p>
   <p>
    <strong>
     <img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/12/22/1a.png" style="height: 151px; width: 150px;">
    </strong>
   </p>
   <pre><strong>输入：</strong>[[1,2],[2,1],[1,0],[0,1]]
<strong>输出：</strong>2.00000
<strong>解释：</strong>最小面积的矩形出现在 [1,2],[2,1],[1,0],[0,1] 处，面积为 2。</pre>
   <p>
    <strong>
     示例 2：
    </strong>
   </p>
   <p>
    <img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/12/23/2.png" style="height: 94px; width: 150px;">
   </p>
   <pre><strong>输入：</strong>[[0,1],[2,1],[1,1],[1,0],[2,0]]
<strong>输出：</strong>1.00000
<strong>解释：</strong>最小面积的矩形出现在 [1,0],[1,1],[2,1],[2,0] 处，面积为 1。
</pre>
   <p>
    <strong>
     示例 3：
    </strong>
   </p>
   <p>
    <img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/12/23/3.png" style="height: 94px; width: 150px;">
   </p>
   <pre><strong>输入：</strong>[[0,3],[1,2],[3,1],[1,3],[2,1]]
<strong>输出：</strong>0
<strong>解释：</strong>没法从这些点中组成任何矩形。
</pre>
   <p>
    <strong>
     示例 4：
    </strong>
   </p>
   <p>
    <strong>
     <img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/12/21/4c.png" style="height: 155px; width: 160px;">
    </strong>
   </p>
   <pre><strong>输入：</strong>[[3,1],[1,1],[0,1],[2,1],[3,3],[3,2],[0,2],[2,3]]
<strong>输出：</strong>2.00000
<strong>解释：</strong>最小面积的矩形出现在 [2,1],[2,3],[3,3],[3,1] 处，面积为 2。
</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     提示：
    </strong>
   </p>
   <ol>
    <li>
     <code>
      1 &lt;= points.length &lt;= 50
     </code>
    </li>
    <li>
     <code>
      0 &lt;=&nbsp;points[i][0] &lt;=&nbsp;40000
     </code>
    </li>
    <li>
     <code>
      0 &lt;=&nbsp;points[i][1] &lt;=&nbsp;40000
     </code>
    </li>
    <li>
     所有的点都是不同的。
    </li>
    <li>
     与真实值误差不超过
     <code>
      10^-5
     </code>
     &nbsp;的答案将视为正确结果。
    </li>
   </ol>
  </div>
 </body>
</html>